<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
	<link href="__PUBLIC__/Css/Admin/Bootstrap/bootstrap.min.css" rel="stylesheet"  >
	<link href="__PUBLIC__/Js/jqui/jquery-ui.min.css" rel="stylesheet"  >
	<script src='__PUBLIC__/Js/jquery-3.1.0.min.js'></script>
	<script src='__PUBLIC__/Js/jqPaginator.js'></script>
	<script src='__PUBLIC__/Js/jqui/jquery-ui.min.js'></script>
	<style>

	</style>

</head>
<body>
<h2>商品添加</h2>
	<div id='msg' class="btn btn-warning" style="display:none;position:absolute;margin-left:500px;"></div>
	<ol class="breadcrumb">
	  <li class="active">填写基本信息</li>
	  <li><a href="javascript:void(0)">添加商品图片</a></li>
	
    </ol>
<div class="panel panel-default">
    <div class="panel-body">
		<form action="<{:U('addphoto')}>" method='post' enctype='multipart/form-data'>
		 <p>添加商品图片</p>
   		 <p><input  type="file" id='file' multiple  name='photo[]'/></p>
	     <p>商品价格<input type="text" name='price' class="form-control" style="width:110px;" /></p>
		 <p>库存<input type="text" name='num' class="form-control" style="width:110px;"/></p>
		 <p>商品品牌<select name="brand"  class="form-control" style="width:120px;">
		       <volist name='brand' id='vo'>
		       		<option value="<{$vo.id}>"><{$vo.brand_name}></option>
		       </volist>			
			  </select></p>
      </form>
	  <a href="<{:U('addpro')}>"><button type='button' name='but_add' class='btn btn-primary'>上一步</button></a>
		<button type='button' id='sub' name='but_add' class='btn btn-primary'>确认提交</button>
    </div>
</div>

<script>
	$("#sub").click(function(){
		var file=$("#file").val();
		if(file!==''){
			$('form').submit();
		}else{
			$("#msg").text("没有上传任何图片");
			$("#msg").css("display",'block');
			setTimeout(function(){$("#msg").fadeOut('slow');},2000);
		}
	});
	
	
</script>

</body>
</html>